{extends file="assets::smarty-templates::Master"|ToPath}
{block name=content}

{html_css file="whiteLabel/light/jquery.datatables.css"}
 
<div id="sombreadoAcademico">
    <ul>
        <li><a class="active" href="#Todas">Todas</a></li>
        <li><a class="active" href="#Pendientes">Pendientes</a></li>
        <li><a class="active" href="#Aprobadas">Aprobadas</a></li>
    </ul>

    {*Todas*}
    <div id="Todas">
        
        <table class="datatable tablesorter-semaforo" >
            <thead>
            <th class="header">Semestre</th>
            <th class="header">C&oacute;digo</th>
            <th class="header">Nombre</th>
            <th class="header">Cr&eacute;ditos</th>
            </thead>
            {foreach $Todas as $semestre}
                {foreach $semestre as $Pensum}
                <tr>
                    {if $Pensum@iteration == 1}
                        <th rowspan="{count($semestre)}" style="vertical-align: middle;">{$Pensum->getNumeroSemestre()}</th>
                    {/if}
                    <td>{$Pensum->getMateria()->getCodigoMateria()}</td>
                    <td>{$Pensum->getMateria()->getNombreMateria()}</td>
                    <td>{$Pensum->getNumeroCreditos()}</td>
                </tr>
                {/foreach}
            {/foreach}
        </table>
    </div>

    {*Pendientes*}
    <div id="Pendientes">
        <table class="datatable tablesorter-semaforo" >
            <thead>
            <th class="header">Semestre</th>
            <th class="header">C&oacute;digo</th>
            <th class="header">Nombre</th>
            <th class="header">Cr&eacute;ditos</th>
            </thead>
            {foreach $Pendientes as $semestre}
                {foreach $semestre as $Pensum}
                    <tr>
                        {if $Pensum@iteration == 1}
                        <th rowspan="{count($semestre)}"style="vertical-align: middle;">{$Pensum->getNumeroSemestre()}</th>
                        {/if}
                        <td>{$Pensum->getMateria()->getCodigoMateria()}</td>
                        <td>{$Pensum->getMateria()->getNombreMateria()}</td>
                        <td>{$Pensum->getNumeroCreditos()}</td>
                    </tr>
                {/foreach}
            {/foreach}
        </table>
    </div>
        
    {*Aprobadas*}
    <div id="Aprobadas">
        <table class="datatable tablesorter-semaforo" >
            <thead>
            <th class="header">Semestre</th>
            <th class="header">C&oacute;digo</th>
            <th class="header">Nombre</th>
            <th class="header">Cursada</th>
            <th class="header">Nota</th>
            </thead>
            {foreach $Aprobadas as $semestre}
                {foreach $semestre as $Curso}
                    <tr>
                        {if $Curso@iteration == 1}
                        <th  rowspan="{count($semestre)}" style="vertical-align: middle;" >{$Curso->getCurso()->getCursoPk()->getSemestre()}</th>
                        {/if}
                        <td>{$Curso->getCurso()->getMateria()->getCodigoMateria()}</td>
                        <td>{$Curso->getCurso()->getMateria()->getNombreMateria()}</td>
                        <td>{$Curso->getCurso()->getCursoPk()->getPerdiodoAcademico()->getAno()} - {$Curso->getCurso()->getCursoPk()->getPerdiodoAcademico()->getPeriodo()}</td>
                        <td>{if $Curso->getNotaDefinitiva() >= 3}{$Curso->getNotaDefinitiva()|string_format:"%.1f"}{else}{$Curso->getNotaValidacion()|string_format:"%.1f"}{/if}</td>
                    </tr>
                {/foreach}
            {/foreach}
        </table>
    </div>
</div>
<script type="text/javascript" >
    {literal}
    require(["jquery", 'jQuery.ui'], function($) {
        $("#sombreadoAcademico").tabs({
            selected:2
        });
    });
    {/literal}
</script>
{/block}
